﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace ATM
{
    public partial class CRtaikhoan : Form
    {
        private SqlConnection conn;
        private SqlDataAdapter da;
        private DataSet ds;
        public CRtaikhoan()
        {
            InitializeComponent();
        }

        private void CRtaikhoan_Load(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection("Data Source=(local);Initial Catalog=ATM_PM1;Integrated Security=True");
            conn.Open();
            String str = "select * from TB_ACCOUNT";
            da = new SqlDataAdapter(str, conn);
            ds = new DataSet();
            da.Fill(ds, "TB_ACCOUNT");

            //rptgiaodich rptgiaodich = new rptgiaodich();
            rptTaikhoan tk = new rptTaikhoan();
            tk.SetDataSource(ds);
            crystalReportViewer1.ReportSource = tk;
            crystalReportViewer1.Show();
        }
    }
}
